<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <script>
        class Preson {
            constructor(name) {
                this.name = name;
            }
        }

        var zhangsan = new Preson("张三");
        console.log(zhangsan.name); // 张三

        class Chinese extends Preson {
            constructor(name) {
                super(name); //super必须要放到this的前面
                // this.name = name;
            }
        }
        var lisi = new Chinese("李四");
        console.log(lisi.name); // 李四
    </script>
</body>

</html>